﻿CREATE TABLE [dbo].[CiMessage] (
    [Id]               INT            IDENTITY (1, 1) NOT NULL,
    [ParentId]         INT            NULL,
    [FunctionId]       NVARCHAR (50)  NULL,
    [CategoryId]       NVARCHAR (50)  NULL,
    [ObjectId]         NVARCHAR (50)  NULL,
    [Title]            NVARCHAR (100) NOT NULL,
    [Content]          NVARCHAR (400) NULL,
    [ReceiverId]       INT            NULL,
    [ReceiverRealname] NVARCHAR (50)  NULL,
    [IsNew]            INT            NULL,
    [ReadCount]        INT            DEFAULT ((0)) NOT NULL,
    [ReadDate]         DATETIME       NULL,
    [TargetURL]        NVARCHAR (400) NULL,
    [IPAddress]        NVARCHAR (50)  NULL,
    [DeleteMark]       INT            DEFAULT ((0)) NOT NULL,
    [Enabled]          INT            DEFAULT ((1)) NOT NULL,
    [Description]      NVARCHAR (200) NULL,
    [SortCode]         INT            NULL,
    [CreateOn]         DATETIME       DEFAULT (getdate()) NOT NULL,
    [CreateUserId]     NVARCHAR (50)  NULL,
    [CreateBy]         NVARCHAR (50)  NULL,
    [ModifiedOn]       DATETIME       NULL,
    [ModifyUserId]     NVARCHAR (50)  NULL,
    [ModifiedBy]       NVARCHAR (50)  NULL,
    CONSTRAINT [PK_CIMESSAGE] PRIMARY KEY NONCLUSTERED ([Id] ASC)
);

